import static org.junit.Assert.*;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class NextDateTest {
	private int year, month, day;
	private String value;
	
	@Before
	public void setUp() throws Exception {
	}
	
	public NextDateTest(int year, int month, int day, String value){
		this.year = year;
		this.month = month;
		this.day = day;
		this.value = value;
	}

	@Parameters
	public static Collection<Object[]> getData() {
		return Arrays.asList(
				new Object[][] { 
				{ 2019, 1, 33, "输入错误，1月只有31天！" },
					{ 2020, 02, 29, "2020.3.1" }, 
					{ 2020, 03, 02, "2020.3.3" }, 
					{ 2019, 12, 31, "2020.1.1" },
					{ 2020, 01, 31, "2020.2.1" }, 
					{ 2019, 02, 28, "2019.3.1" }, 
					{ 2019, 04, 30, "2019.5.1" },
					{ 2020, 00, 21, "月份输入错误！" },
		});
	}

	@Test
	public void testClassify() {
		assertEquals(this.value, NextDate.classify(year, month, day));
	}

}
